function f1() {
  let x = 0;
  return {
    inc() {
      return ++x;
    },
  };
}

let result = f1();

console.log(result.inc());
console.log(result.inc());
console.log(result.inc());
